import request from '@/utils/request'

// 标签列表
export function getLabelListApi(pagesize, page, oldPassword, newPassword) {
  return request({
    url: `/tags`,
    method: 'get',
    params: {
      pagesize,
      page,
      oldPassword,
      newPassword
    }
  })
}

// 标签列表
export function getLabelListsApi(subjectID) {
  return request({
    url: `/tags`,
    method: 'get',
    params: {
      subjectID
    }
  })
}

// 标签搜索
export function getSearchListApi(params) {
  return request({
    url: `/tags`,
    method: 'get',
    params
  })
}

// 标签删除
export function delLabelListApi(id) {
  return request({
    url: `/tags/${id}`,
    method: 'delete'
  })
}

// 标签回显
export function showLabelDetailApi(id) {
  return request({
    url: `/tags/${id}`,
    method: 'get'
  })
}

// 标签修改
export function editLabelListApi(data) {
  return request({
    url: `/tags/${data.id}`,
    method: 'put',
    data
  })
}

// 标签新增
export function addLabelListApi(data) {
  return request({
    url: `/tags`,
    method: 'post',
    data
  })
}

// 标签状态
export function labelStateApi(id, state) {
  return request({
    url: `/tags/${id}/${state}`,
    method: 'post',
    data: {
      id,
      state
    }
  })
}
